<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib prefix="sys" uri="/WEB-INF/tld/sys.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>申诉详情页面</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <form id="add_form">
        <div class="fieldset1 tabel_col tabel_col_1 clearFix">
            <div class="fieldBox col_100">
                <div class="label">审核ID</div>
                <div class="field">
                    <input name="appealId" id="appealId" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.appealId}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">审核员</div>
                <div class="field">
                    <input name="auditUserName" id="auditUserName" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.auditUserName}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">姓名</div>
                <div class="field">
                    <input name="usrNm" id="usrNm" type="text" class="ui-textbox" disabled="disabled" value="${detail.usrNm}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">证件类型</div>
                <div class="field">
                    <input name="certType" id="certType" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.certType}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">证件号码</div>
                <div class="field">
                    <input name="certNo" id="certNo" type="text" class="ui-textbox" disabled="disabled" value="${detail.certNo}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">活体渠道</div>
                <div class="field">
                    <input name="liveChannel" id="liveChannel" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.liveChannel}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">活体类型</div>
                <div class="field">
                    <input name="liveType" id="liveType" type="text" class="ui-textbox" disabled="disabled" value="${detail.liveType}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">合同号</div>
                <div class="field">
                    <input name="contractNo" id="contractNo" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.contractNo}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">机构名称</div>
                <div class="field">
                    <input name="insName" id="insName" type="text" class="ui-textbox" disabled="disabled" value="${detail.insName}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">有效时间</div>
                <div class="field">
                    <input name="validTime" id="validTime" type="text" data-type="text" class="ui-textbox" disabled="disabled" value="${detail.validTime}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">留言</div>
                <div class="field">
                    <%--<input name="appealMsg" id="appealMsg" type="text" class="ui-textbox" disabled="disabled" value="${detail.appealMsg}">--%>
                    <textarea name="appealMsg" id="appealMsg" rows="4" cols="50" disabled="disabled">${detail.appealMsg}</textarea>
                </div>
            </div>
        </div>
        <div class="fieldset1 tabel_col tabel_col_1 clearFix">
            <div class="fieldBox col_100">
                <table align="center" width="96%" border="1" cellspacing="1" cellpadding="0" class="resulttable">
                    <tr bgcolor="#90ee90">
                        <th width="16%" name="fileId">资料ID</th>
                        <th width="16%" name="fileType">资料名称</th>
                        <th width="16%" name="fileUrl">附件</th>
                        <th width="16%" name="crtTm">上传时间</th>
                        <th width="16%" name="state">验证状态</th>
                        <th width="16%">操作</th>
                    </tr>
                    <c:if test="${ empty detail.appealFileInfos}">
                        <tr><td align="center" colspan="10" class="" >无记录</td></tr>
                    </c:if>
                    <c:if test="${ not empty detail.appealFileInfos}">
                    <c:forEach var="bean" items="${ detail.appealFileInfos}" varStatus="s">
                    <tr>
                        <td align="left" name="fileId">
                            <input name="fileId" value="${bean.fileId}"/>
                        </td>
                        <td align="left">
                            <c:out value="${bean.fileType}"/>
                        </td>
                        <td align="left">
                            <c:out value="${bean.fileUrl}"/>
                        </td>
                        <td align="left">
                            <c:out value="${bean.crtTm}"/>
                        </td>
                        <td align="left">
                            <c:out value="${bean.state}"/>
                        </td>
                        <td align="left">
                            <input type="radio" name="validType+'${s.index}'" <c:if test="${bean.state == '已检查'}">checked="checked"</c:if> value="1" onchange="changeStatus('${bean.fileId}','1')">验证通过
                            <input type="radio" name="validType+'${s.index}'" <c:if test="${bean.state == '未检查'}">checked="checked"</c:if> value="0" onchange="changeStatus('${bean.fileId}','0')">验证不通过
                            <%--<span id="check_Btn" class="sq-button sq-button-hasicon l-dialog-btn-ok"><i class="sqBtnIco_4" onclick="changeStatus('${bean.fileId}','${bean.state}')"></i>检查</span>--%>
                        </td>
                    </tr>
                    </c:forEach>
                    </c:if>
                </table>
            </div>
            <div class="fieldBox col_100">
                <table align="center" width="96%" border="1" cellspacing="1" cellpadding="0" class="resulttable">
                    <tr>
                        <th width="16%" bgcolor="#90ee90">结论</th>
                        <th width="80%">
                            <textarea name="busRem" id="busRem" rows="4" cols="50">${detail.busRem}</textarea>
                        </th>
                    </tr>
                </table>
            </div>
        </div>
        <div class="btnsBox" align="center">
            <span id="save_Btn" class="sq-button sq-button-hasicon l-dialog-btn-ok"><i class="sqBtnIco_10"></i>保存</span>
        </div>
    </form>
</div>
<script type="text/javascript">
        $("#save_Btn").click(function(){
            $("#add_form").ligerForm({validate:true});
            var ligerForm = liger.get("add_form");
            var data = ligerForm.getData();
            var url = '<%=path%>/liveappeal/liveappeal/update.do';
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: url,
                success:function(data){
                    if (data.success == 1) {
                        alert("保存成功")
                        location.reload();
                    } else {
                        alert("保存失败," + data.info)
                        location.reload();
                    }
                }
            });
        })

    function changeStatus(fileId,state){

        // var status = '';
        // if (state == '已检查'){
        //     status = '0';
        // } else {
        //     status = '1';
        // }
        var url = '<%=path%>/liveappeal/liveappeal/updateFileStatus.do?fileId='+fileId+"&status="+state;
        $.ajax({
            type: 'get',
            dataType: 'json',
            url: url,
            success:function(data){
                if (data.success == 1) {
                    alert("更新成功")
                    location.reload();
                } else {
                    alert("更新失败," + data.info)
                    location.reload();
                }
            }
        });
    }
</script>

</body>
</html>